export default (initialState: any) => {
  // 在这里按照初始化数据定义项目中的权限，统一管理
  // 参考文档 https://umijs.org/docs/max/access
  const { currentPermission, originPerminssions } = initialState || {};

  return {
    force: () => {
      return true;
    },
    routeAccess: (route: any): boolean => {
      // console.log(route, 'route');
      // return currentPermission?.includes(route?.accessKey);
      return true;
    },
    pageBtnsAccess: (key: any): boolean => {
      // 页面调取的按钮权限
      return originPerminssions?.includes(key);
    },
  };
};
